"""
 @author adun
 @date 2021/8/28 23:11
"""
from unittest import TestCase

def test_openFile():
    # 打开文件
    fo = open("json-test.txt", "r", encoding="utf-8")
    print("文件名为: ", fo.name)

    for line in fo.readlines():  # 依次读取每行
        # line = line.strip()  # 去掉每行头尾空白
        # print("读取的数据为: %s" % (line))
        print(line,end="")

    # 关闭文件
    fo.close()



if __name__ == '__main__':
    test_openFile()
